package com.example.sunmiv1.entity;

import android.content.Context;
import android.content.ContextWrapper;
import android.graphics.Color;
import android.text.Spannable;
import android.text.SpannableString;
import android.text.style.ForegroundColorSpan;

import com.example.sunmiv1.R;

import java.util.List;

public class AllocationTubeBean {
    /**
     * status : 1
     * msg : 查詢成功
     * data : [{"id":"216","merchant_id":"1","store_id":"1","supplier_id":"0","transfer_to_store_id":"2","warehouse_record_id":"478","warehouse_id":"392","order_number":"SD201911180216","money_total":64,"goods_species":"8","real_goods_species":"8","real_money_total":64,"remarks":"","status":"1","type":"3","warehousing_status":"1","examine_status":"1","add_time":"2019-11-18 14:10:57","warehouse_time":"2019-11-18 14:12:26","operator_id":"167","operator_type":"0","total_cost_price":"64.00","index":1,"store_name":"姑蘇直營店","transfer_name":null,"examine_name":"已入庫"},{"id":"213","merchant_id":"1","store_id":"1","supplier_id":"0","transfer_to_store_id":"2","warehouse_record_id":"472","warehouse_id":"392","order_number":"SD201911160213","money_total":40,"goods_species":"1","real_goods_species":"1","real_money_total":40,"remarks":" ergt e","status":"1","type":"3","warehousing_status":"1","examine_status":"1","add_time":"2019-11-16 14:37:44","warehouse_time":"2019-11-18 10:59:07","operator_id":"167","operator_type":"0","total_cost_price":"40.00","index":2,"store_name":"姑蘇直營店","transfer_name":null,"examine_name":"已入庫"},{"id":"212","merchant_id":"1","store_id":"1","supplier_id":"0","transfer_to_store_id":"2","warehouse_record_id":"471","warehouse_id":"392","order_number":"SD201911150212","money_total":240,"goods_species":"1","real_goods_species":null,"real_money_total":null,"remarks":"","status":"1","type":"3","warehousing_status":"0","examine_status":"1","add_time":"2019-11-15 16:37:14","warehouse_time":false,"operator_id":"167","operator_type":"0","total_cost_price":"240.00","index":3,"store_name":"姑蘇直營店","transfer_name":null,"examine_name":"未入庫"}]
     */

    private int status;
    private String msg;
    private List<DataBean> data;

    public int getStatus() {
        return status;
    }

    public void setStatus(int status) {
        this.status = status;
    }

    public String getMsg() {
        return msg;
    }

    public void setMsg(String msg) {
        this.msg = msg;
    }

    public List<DataBean> getData() {
        return data;
    }

    public void setData(List<DataBean> data) {
        this.data = data;
    }

    public static class DataBean {
        /**
         * id : 216
         * merchant_id : 1
         * store_id : 1
         * supplier_id : 0
         * transfer_to_store_id : 2
         * warehouse_record_id : 478
         * warehouse_id : 392
         * order_number : SD201911180216
         * money_total : 64
         * goods_species : 8
         * real_goods_species : 8
         * real_money_total : 64
         * remarks :
         * status : 1
         * type : 3
         * warehousing_status : 1
         * examine_status : 1
         * add_time : 2019-11-18 14:10:57
         * warehouse_time : 2019-11-18 14:12:26
         * operator_id : 167
         * operator_type : 0
         * total_cost_price : 64.00
         * index : 1
         * store_name : 姑蘇直營店
         * transfer_name : null
         * examine_name : 已入庫
         */

        private String id;
        private String merchant_id;
        private String store_id;
        private String supplier_id;
        private String transfer_to_store_id;
        private String warehouse_record_id;
        private String warehouse_id;
        private String order_number; // 4  調撥單號
        private double money_total;
        private String goods_species;
        private String real_goods_species; // 6 實收合計(種)
        private double real_money_total;  // 7 實收金額
        private String remarks; // 8 備註
        private String status;//
        private String type;
        private String warehousing_status; //   商戶或者門店 是否入庫 0未入庫  1已入庫
        private String examine_status;  // 通過|拒絕   門店調撥出庫商戶審覈   0未審覈  1審覈通過 2審覈失敗
        private String add_time;  // 2  調撥時間
        private String warehouse_time;  // 3 入庫時間
        private String operator_id;
        private String operator_type;
        private String total_cost_price;
        private int index;
        private String store_name;
        private String transfer_name; // 5  貨至門店名
        private String examine_name;  // 1  後臺已判斷該字段顯示審覈狀態|入庫狀態  先判斷審覈  再判斷入庫

        public String getId() {
            return id == null ? "" : id;
        }

        public void setId(String id) {
            this.id = id;
        }

        public String getMerchant_id() {
            return merchant_id == null ? "" : merchant_id;
        }

        public void setMerchant_id(String merchant_id) {
            this.merchant_id = merchant_id;
        }

        public String getStore_id() {
            return store_id == null ? "" : store_id;
        }

        public void setStore_id(String store_id) {
            this.store_id = store_id;
        }

        public String getSupplier_id() {
            return supplier_id == null ? "" : supplier_id;
        }

        public void setSupplier_id(String supplier_id) {
            this.supplier_id = supplier_id;
        }

        public String getTransfer_to_store_id() {
            return transfer_to_store_id == null ? "" : transfer_to_store_id;
        }

        public void setTransfer_to_store_id(String transfer_to_store_id) {
            this.transfer_to_store_id = transfer_to_store_id;
        }

        public String getWarehouse_record_id() {
            return warehouse_record_id == null ? "" : warehouse_record_id;
        }

        public void setWarehouse_record_id(String warehouse_record_id) {
            this.warehouse_record_id = warehouse_record_id;
        }

        public String getWarehouse_id() {
            return warehouse_id == null ? "" : warehouse_id;
        }

        public void setWarehouse_id(String warehouse_id) {
            this.warehouse_id = warehouse_id;
        }

        public String getOrder_number() {
            return order_number == null ? "" : order_number;
        }

        public void setOrder_number(String order_number) {
            this.order_number = order_number;
        }

        public double getMoney_total() {
            return money_total;
        }

        public void setMoney_total(double money_total) {
            this.money_total = money_total;
        }

        public String getGoods_species() {
            return goods_species == null ? "" : goods_species;
        }

        public void setGoods_species(String goods_species) {
            this.goods_species = goods_species;
        }

        public String getReal_goods_species() {
            return real_goods_species == null ? "" : real_goods_species;
        }

        public void setReal_goods_species(String real_goods_species) {
            this.real_goods_species = real_goods_species;
        }

        public double getReal_money_total() {
            return real_money_total;
        }

        public void setReal_money_total(double real_money_total) {
            this.real_money_total = real_money_total;
        }

        public String getRemarks() {
            return remarks == null ? "" : remarks;
        }

        public void setRemarks(String remarks) {
            this.remarks = remarks;
        }

        public String getStatus() {
            return status == null ? "" : status;
        }

        public void setStatus(String status) {
            this.status = status;
        }

        public String getType() {
            return type == null ? "" : type;
        }

        public void setType(String type) {
            this.type = type;
        }

        public String getWarehousing_status() {
            return warehousing_status == null ? "" : warehousing_status;
        }

        public void setWarehousing_status(String warehousing_status) {
            this.warehousing_status = warehousing_status;
        }

        public String getExamine_status() {
            return examine_status == null ? "" : examine_status;
        }

        public void setExamine_status(String examine_status) {
            this.examine_status = examine_status;
        }

        public String getAdd_time() {
            return add_time == null ? "" : add_time;
        }

        public void setAdd_time(String add_time) {
            this.add_time = add_time;
        }

        public String getWarehouse_time() {
            return warehouse_time == null ? "" : warehouse_time;
        }

        public void setWarehouse_time(String warehouse_time) {
            this.warehouse_time = warehouse_time;
        }

        public String getOperator_id() {
            return operator_id == null ? "" : operator_id;
        }

        public void setOperator_id(String operator_id) {
            this.operator_id = operator_id;
        }

        public String getOperator_type() {
            return operator_type == null ? "" : operator_type;
        }

        public void setOperator_type(String operator_type) {
            this.operator_type = operator_type;
        }

        public String getTotal_cost_price() {
            return total_cost_price == null ? "" : total_cost_price;
        }

        public void setTotal_cost_price(String total_cost_price) {
            this.total_cost_price = total_cost_price;
        }

        public int getIndex() {
            return index;
        }

        public void setIndex(int index) {
            this.index = index;
        }

        public String getStore_name() {
            return store_name == null ? "" : store_name;
        }

        public void setStore_name(String store_name) {
            this.store_name = store_name;
        }

        public String getTransfer_name() {
            return transfer_name == null ? "" : transfer_name;
        }

        public void setTransfer_name(String transfer_name) {
            this.transfer_name = transfer_name;
        }

        public void setExamine_name(String examine_name) {
            this.examine_name = examine_name;
        }

        public SpannableString getExamine_name() {
            SpannableString s=new SpannableString(examine_name);
            ForegroundColorSpan foregroundColorSpan;
            if(examine_name.equals("已入庫")){
                foregroundColorSpan=new ForegroundColorSpan(Color.GREEN);
            }else{
                foregroundColorSpan=new ForegroundColorSpan(Color.rgb(0xFF,0x66,0x73));
            }
            s.setSpan(foregroundColorSpan,0,s.length(), Spannable.SPAN_INCLUSIVE_EXCLUSIVE);
            return s;
        }

    }
}
